package com.earl.handler;

import com.geccocrawler.gecco.GeccoEngine;
import com.geccocrawler.gecco.annotation.*;
import com.geccocrawler.gecco.request.HttpGetRequest;
import com.geccocrawler.gecco.spider.HtmlBean;

/**
 * Created by 知鹏 on 2018/6/21.
 */

    public class GeccoTest{


        public static void main(String[] args) {
            HttpGetRequest startUrl = new HttpGetRequest("http://list.jd.com/list.html?cat=9987,653,659&delivery=1&page=1&JL=4100&go=0");
            startUrl.setCharset("GBK");
            GeccoEngine.create()
                    //Gecco搜索的包路径
                    .classpath("com.earl.jdBook")
                    //开始抓取的页面地址
                    .start(startUrl)
                    //开启几个爬虫线程
                    .thread(1)
                    //单个爬虫每次抓取完一个请求后的间隔时间
                    .interval(2000)
                    .run();
        }
    }

